import { get } from "mobx";
import { Http } from "../myHttp.jsx";

//新房 
///floor/searchFloor
//数据初始化
const getAllFloor = () => {
    return Http('/floor/getAllFloor', 'get').then((res) => { return res })
}

//查询
const fetchData = (params) => {
    return Http('/floor/searchFloor', 'post', params).then((res) => { return res })
}

//新增
const addFloor = (params) => {
    return Http('/floor/addFloor', 'post', params).then((res) => { return res })
}

//删除
const delFloor = (params) => {
    return Http('/floor/delete', 'get', params).then((res) => { return res })
}

//上下线
const change = (params) => {
    return Http('/floor/change', 'get', params).then((res) => { return res })
}

//添加户型
const addMsg = (params) => {
    return Http('/floor/addMsg', 'post', params).then((res) => { return res })
}

// 楼盘动态 get 
const getTrend = (params) => {
    return Http('/floor/getTrend', 'get', params).then((res) => { return res })
}

//搜索楼盘动态    get 
const searchTrend = (params) => {
    return Http('/floor/searchTrend', 'get', params).then((res) => { return res })
}

//添加楼盘动态    post 
const addTrend = (params) => {
    return Http('/floor/addTrend', 'post', params).then((res) => { return res })
}

//编辑楼盘动态    post 
const editTrend = (params) => {
    return Http('/floor/editTrend', 'post', params).then((res) => { return res })
}

//删除楼盘动态    get 
const deleteTrend = (params) => {
    return Http('/floor/deleteTrend', 'get', params).then((res) => { return res })
}

//个人用户
//数据    get  
const getAll = () => {
    return Http('/personal/getAll', 'get').then((res) => { return res })
}

//查询  get  
const search = (params) => {
    return Http('/personal/search', 'get', params).then((res) => { return res })
}

//重置密码    get 
const resetPassword = (params) => {
    return Http('/personal/resetPassword', 'get', params).then((res) => { return res })
}

//锁定    get 
const Change = (params) => {
    return Http('/personal/change', 'get', params).then((res) => { return res })
}

//   添加    post 
const add = (params) => {
    return Http('/personal/add', 'post', params).then((res) => { return res })
}

//查询当前用户 get 
const getTheOne = (params) => {
    return Http('/personal/getTheOne', 'get', params).then((res) => { return res })
}

// 编辑    post 
const edit = (params) => {
    return Http('/personal/edit', 'post', params).then((res) => { return res })
}

//  删除 get 
const deletePer = (params) => {
    return Http('/personal/delete', 'get', params).then((res) => { return res })
}

//经纪人
//数据
const allBorker = () => {
    return Http('/broker/getAll', 'get').then((res) => { return res })
}

//查询    get  
const searchBro = (params) => {
    return Http('/broker/search', 'get', params).then((res) => { return res })
}

//重置密码    get 
const resetPass = (params) => {
    return Http('/broker/resetPassword', 'get', params).then((res) => { return res })
}

//添加    post 
const addBro = (params) => {
    return Http('/broker/add', 'post', params).then((res) => { return res })
}

//查询当前用户 get 
const getTheBro = (params) => {
    return Http('/broker/getTheOne', 'get', params).then((res) => { return res })
}

//编辑    post 
const editBro = (params) => {
    return Http('/broker/edit', 'post', params).then((res) => { return res })
}

export{
    //新楼
    getAllFloor,fetchData,addFloor,delFloor,change,addMsg,
    getTrend,searchTrend,addTrend,editTrend,deleteTrend,
    //个人用户
    getAll,search,resetPassword,Change,add,getTheOne,edit,
    deletePer,
    //经纪人
    allBorker,searchBro,resetPass,addBro,getTheBro,editBro
}